Conversation
| <script src="../js/minitpl.js"></script> | ||
| <script src="../js/board.js"></script> | ||
| <script src="../tools/pencil/wbo_pencil_point.js"></script> | ||
| <script src="../tools/new/new.js"></script> |
There was a problem hiding this comment.
It should probably not be called new, but something like clear
| Tools.socket.emit('broadcast', { | ||
| board: Tools.boardName, | ||
| data : { | ||
| tool : "New", | ||
| type : "deleteall" | ||
| } | ||
| }); | ||
| Tools.drawingArea.innerHTML = ''; |
There was a problem hiding this comment.
Tools.socket shouldn't be used directly. You can use drawAndSend. See other tools for an example.
There was a problem hiding this comment.
Also, there should probably be a confirmation prompt. This erases all data forever, which could represent days of work by multiple people.
| case "deleteall": | ||
| Tools.drawingArea.innerHTML = ''; | ||
| break; |
| } | ||
|
|
||
| Tools.add({ | ||
| "name": "New", |
| "name": "New", | ||
| "shortcut": "n", | ||
| "listeners": {}, | ||
| "icon": "tools/new/new.svg", |
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Generator: Adobe Illustrator 24.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> | ||
| <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | ||
| viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> | ||
| <g> | ||
| <polygon points="448,80 512,80 512,112 448,112 448,176 416,176 416,112 352,112 352,80 416,80 416,16 448,16 "/> | ||
| <path d="M32,112h256V80H32C14.3,80,0,94.3,0,112v352c0,17.7,14.3,32,32,32h384c17.7,0,32-14.3,32-32V247.3h-32V464H32V112z"/> | ||
| </g> | ||
| </svg> |
There was a problem hiding this comment.
This icon makes it look like something new is being created, wheras all the data on the board is erased and lost forever.
| */ | ||
| BoardData.prototype.deleteall = function () { | ||
| //KISS | ||
| this.board = []; |
There was a problem hiding this comment.
This.board is an object, not an array
| if (id) board.delete(id); | ||
| break; | ||
| case "deleteall": | ||
| board.deleteall(); |
There was a problem hiding this comment.
We should check that the tool is activated, and this tool should probably not be activated by default.
|
See #92 and #90 and the discussion in jitsi/jitsi-meet#5295 Such a tool is very dangerous, since it allows a single misbehaving user to sabotage the work of all others on a large whiteboard. This tool should be disabled by default, and be possible to enable through configuration. |
|
I agree with your suggesstion @lovasoa |
this is for #151 #120
add erase all button on menu